package com.campus.common.message;


import java.io.Serializable;
import com.campus.common.vo.Book;

public class LibraryRequest extends BaseMessage implements Serializable {
    private static final long serialVersionUID = 1L;
    private String action;  // "list", "borrow", "return"
    private int bookId;
    private Book book;
    private String searchTitle;
    private String searchAuthor;
    private String username;
    private String bookTitle;
    private String category;
    public LibraryRequest() {}
    public LibraryRequest(String action, int bookId) {
        this.action = action;
        this.bookId = bookId;
    }
    public LibraryRequest(String action, int bookId, boolean getBorrowersById) {
        this.action = action;
        this.bookId = bookId;
    }
    public LibraryRequest(String action, Book book) {
        this.action = action;
        this.book = book;
    }
    public LibraryRequest(String action, String searchTitle, String searchAuthor) {
        this.action = action;
        this.searchTitle = searchTitle;
        this.searchAuthor = searchAuthor;
    }
    public LibraryRequest(String action, int bookId, String username) {
        this.action = action;
        this.bookId = bookId;
        this.username = username;
    }
    public LibraryRequest(String action, String category, boolean isCategorySearch) {
        this.action = action;
        this.category = category;
    }

    public LibraryRequest(String action, String username) {
        this.action = action;
        this.username = username;
    }


    public String getAction() { return action; }
    public int getBookId() { return bookId; }
    public Book getBook() { return book; }
    public String getUsername() {
        return username;
    }
    public String getBookTitle() {
        return bookTitle;
    }
    public String getSearchTitle() { return searchTitle; }
    public String getSearchAuthor() { return searchAuthor; }
    public String getCategory() { return category; }
}
